package org.example.leetcode.core.job;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.example.leetcode.core.api.TQuestionPublicService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author topto
 */
@Component
@Slf4j
public class DailyQuestionGenerationJob {
    @Resource
    TQuestionPublicService tQuestionPublicService;
    @XxlJob(value = "dailyQuestion")
    public void execute(){
        String jobParam = XxlJobHelper.getJobParam();
        tQuestionPublicService.dailyQuestionGenerate(jobParam);
    }
}
